#include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;
int sushu[1000000];
int cnt;
void chuli()
{
	int n;
	cin >> n;
	cnt = 0;
	bool is_sushu = true;
	for (int i=2;i<=n;i++)
	{
		for (int j=2 ;j<i;j++)
		{
			if (i%j==0)
			{
				is_sushu = false;
				break;
			}	
		}	
		if (is_sushu)
		{
			sushu[cnt] = i;
			cnt++;
		}
		is_sushu = true;
	}
	cout << cnt << endl;
	/**/
	for (int i=0;i<cnt;i++)
	{
		cout << sushu[i] << " "; 
	}
		cout << endl;
	
		
}
int main()
{
	chuli();
	return 0;
}
